package week4;

import javax.swing.*;
import java.awt.*;

/**
 * @author The Setting sun
 * @create 2021-09-29 9:23
 */
public class Star {
    public static void main(String[] args) {
        JFrame jf = new JFrame();

        class MyPaint extends JPanel{
            @Override
            public void paint(Graphics g) {
                g.setColor(Color.WHITE);
                g.setFont(new Font("微软雅黑", Font.BOLD, 17));
                for (int i = 0; i < 300; i++) {
                    g.drawString("*", (int)(Math.random() * 1919 + 1), (int)(Math.random() * 1079 + 1));
                }

                g.fillOval(100, 100, 200, 200);

                g.setColor(Color.BLACK);
                g.fillOval(100, 100, 150, 150);
            }
        }

        jf.add(new MyPaint());

        jf.setSize(1920, 1080);
        jf.setVisible(true);
        jf.setLocationRelativeTo(null);
        jf.setBackground(Color.BLACK);
        jf.setResizable(false);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
